Hi everyone,
I'm encountering an issue with a loop in Stata where the loop stops at the 100th iteration and throws an error message. It seems like there's a limitation on the number of timers that can be used, which is set to 100 by default. When my loop reaches the 101st iteration, it fails.
Is there a way to increase this limit from 100 to a higher value, like 300, so that my loop can run without interruption?
Thanks in advance for your help!
I'm encountering an issue with a loop in Stata where the loop stops at the 100th iteration and throws an error message. It seems like there's a limitation on the number of timers that can be used, which is set to 100 by default. When my loop reaches the 101st iteration, it fails.
Is there a way to increase this limit from 100 to a higher value, like 300, so that my loop can run without interruption?
Thanks in advance for your help!
Code:
local listx h_gender hh_age hh_maritst edu1 edu2 edu3 edu4 hh_size child0_5 urban land_size female_hh
*local index spi zscore delta
local depv d_migr d_migr_internal d_migr_abroad n_migr n_migr_abroad n_migr_internal sh_migr sh_migr_abroad sh_migr_internal totremit d_remit d_tremit
local j 1
local i 1
foreach y in `depv' {
foreach ind in `index' {
forvalue d=1(1)18{
timer on `j'
local opt= cond(`i'==1, "replace", "append")
local listx "h_gender hh_age hh_maritst edu1 edu2 edu3 edu4 hh_size child0_5 urban land_size female_hh"
quietly xtreg `y' did`d'_`ind' treated`d'_`ind' `listx' i.year, fe vce (cluster coato)
outreg2 using "C:\Users\User\Desktop\corrtables\DiD.xls"
local i=`i'+1
local opt= cond(`i'==1, "replace", "append")
timer off `j'
timer list `j'
display as text "Estimation for `ind'" "Elapsed time in minutes: " as result %3.2f `=(`r(t`j')')/60'
timer clear `j'
local j=`j'+1
}
}
}

Comment